/**
 * 评论功能相关接口
 */
// @ts-ignore
import request from "../utils/request";

interface UnknownObject {
  [key: string]: unknown
}

// 获取评论列表
export const getCommentList = (id: string | number) => {
  return request(`/basic/Comment/${id}`, {
    method: "GET"
  });
};

// 发表评论
export const publishComment = (data: UnknownObject) => {
  return request("/basic/Comment", {
    method: "POST",
    data
  });
};

// 删除评论
export const deleteComment = (id: string | number) => {
  return request(`/basic/Comment/${id}`, {
    method: "DELETE"
  });
};

// 审核评论
export const auditComment = (data: UnknownObject) => {
  return request("/basic/Comment/Audit", {
    method: "POST",
    data
  });
};
